package com.cyh.pangu.offer;

import java.util.concurrent.TimeUnit;

public class Offer11 {

    public int minArray(int[] numbers) {
        int low = 0;
        int height = numbers.length -1 ;
        while (low < height) {
            int pivot = low + (height - low ) / 2;
            if (numbers[pivot] > numbers[height]) {
                low = pivot + 1;
            } else if (numbers[pivot] < numbers[height]) {
                height = pivot;
            } else {
                height -- ;
            }

        }
        return numbers[low];
    }

    public static void main(String[] args) {
        int[] arr = new int[]{2,2,2,0,1};
        Offer11 offer11 = new Offer11();
        int value = offer11.minArray(arr);
        System.out.println("v:" + value);


    }
}
